<?php
/** ***********************
 * 作者：卢逸 www.61php.com
 * 日期：2015/5/21
 * 作用：数据模型
 ** ***********************/
class coreModelHome extends coreFrameworkModel {
	function test(){
		//默认的数据库源
		$sql=SqlToolsClass::SelectItem("admin");
		$datas=$this->GetAll($sql);
		
		//切换数据库源
		/*$sql=SqlToolsClass::SelectItem("activities_company_bind");
		$datas=$this->GetRow($sql,"test");*/
		
		//切换回默认的数据源
		$sql=SqlToolsClass::SelectItem("admin");
		$datas=$this->GetAll($sql);
	}
	function checkuser($post){
		$username=$post['username'];
		$password=md5(md5($post['password']));
		$sql=SqlToolsClass::SelectItem("admin","username='$username' and password='$password'");
		return $this->GetRow($sql);
	}
	//检测
	function checkChannelUser($post){
		$name=$post['name'];
		$password=md5(md5($post['password']));
		$sql=SqlToolsClass::SelectItem("channel_user","name='$name' and password='$password'");
		return $this->GetRow($sql);
	}
	function updataUserLogin($data,$id){
		$sql=SqlToolsClass::EditData("admin", $data, "id=$id");
		$this->Execute($sql);
	}
}
?>